﻿using JST.TPLMS.Contract;
using JST.TPLMS.Contract.IBaseFiles;
using JST.TPLMS.DataBase;


namespace JST.TPLMS.Repository.BaseFiles
{
    public class UnitOfWork : IUnitOfWork
    {
        private readonly TPLMSDbContext _db;

        public ISupplierRepository SupplierRepo { get; private set; }
        public ICargoRepository CargoRepo { get; private set; }

        public UnitOfWork(TPLMSDbContext db)
        {
            _db = db;
            SupplierRepo = new SupplierRepository(_db);
            CargoRepo = new CargoRepository(_db);
        }

        public void Save()
        {
            _db.SaveChanges();
        }
    }
}
